home *** CD-ROM | disk | FTP | other *** search
/ Georgia Wildfire Prevention / Georgia Wildfire Prevention.iso / mac / media / dirs / BackUp / Test.dir / 00005_Script_Special Button BehaviorSpecial Button Behavior__.ls < prev    next >
Text File  |  2002-10-15  |  3KB  |  86 lines

  1. --PROPERTIES--
  2. --Hot: The member switched to (hot state).
  3. --FlashSpeed: The speed in which the sprite flashes measured in ticks (1/60th of a sec.)
  4. --Message: The message sent to the stage.
  5. --Glowing: Lets the function know if the sprite is hot or cold.
  6. --RollOvr: The member switched to when rolled-over.
  7. --ButtonSound: The sound that will play when clicked. Channel 2 is reserved for short sounds.
  8. --TimeTracker: Times out the seconds between flashes.
  9. --SpNum: The sprite number of the sprite.
  10. --MyNum: The member's number.
  11. --FlashWait: How long to wait before flashing
  12.  
  13. global zeus
  14. property Hot, FlashSpeed, Message, Glowing, RollOvr, ButtonSound, TimeTracker, SpNum, MyNum, FlashWait, TheData
  15.  
  16. --Captures the spritenumber.
  17. on new me
  18.   SpNum = me.spritenum
  19.   MyNum=sprite(SpNum).member.number
  20.   theData = [:]
  21. end
  22.  
  23. --Creates the dialog box for the behavior.
  24. on getpropertydescriptionlist me
  25.   set pList = [#Hot:[#comment: "What is the cast member name for the Hot state?", #format: #string, #default: ""], \
  26.  #RollOvr: [#comment: "Which member would you like to use for the rollover?", #format: #string, #default: ""], \
  27.  #ButtonSound:[#comment: "What sound would you like to play when the button is pressed?",#format:#string,#default:"Click"],\
  28.  #Message:[#comment:"What movie would you like to open?",#format:#string,#default: "Next"],\
  29.  #FlashSpeed:[#comment:  "How often would you like the member to flash (ticks)?", #format: #integer, #range: [#min: 0, #max: 60], #default: 0], \
  30.  #FlashWait: [#comment: "How Long would you like to wait before Flashing (ticks)?", #format:#integer, #default: "0"]]
  31.   return plist
  32. end
  33.  
  34. --This toggles the flashing object back  and forth at the desired speed while the mouse is not over it.
  35. --on prepareframe me
  36. --  if FlashSpeed <> 0 then
  37. --    if the timer > FlashWait then
  38. --      if sprite(SpNum).cursor <> 280 then
  39. --        set TimeTracker = the ticks
  40. --        repeat while the ticks < TimeTracker + FlashSpeed
  41. --          nothing
  42. --        end repeat
  43. --        if Glowing = 0 then
  44. --          sprite(SpNum).membernum = member(Hot).number
  45. --          Glowing = Glowing + 1
  46. --        else
  47. --          sprite(SpNum).membernum = member(MyNum).number
  48. --          Glowing = GLowing - 1
  49. --        end if
  50. --        updateStage
  51. --      end if
  52. --    end if
  53. --  end if
  54. --end
  55.  
  56. --This is for the rollover.
  57. on mouseenter me
  58.   sprite(SpNum).membernum = member(RollOvr).number
  59.   sprite(SpNum).cursor = 280  
  60.   updateStage  
  61. end
  62. on mouseleave me
  63.   sprite(SpNum).membernum = member(MyNum).number
  64.   sprite(SpNum).cursor = 293 
  65.   Glowing = 0
  66.   updateStage
  67. end
  68.  
  69. --This goes to another frame and tells the movie what to do. Also plays the sound, if any.
  70. on mouseup me
  71.   if  ButtonSound <> "" then
  72.     sound(2).play(member(ButtonSound)) 
  73.   end if
  74.   sendallsprites(#Turnin)
  75.   EnterData (zeus, TheData)
  76.   Hermes = Void
  77.   WhichMovie (zeus, message)
  78. end
  79.  
  80. on thereply me, ReturnedName, ReturnedData
  81.   setaprop(TheData, symbol(ReturnedName), ReturnedData)
  82. end
  83.  
  84.  
  85.  
  86.